<?php
namespace app\index\controller;
use think\Loader;
class News extends Base{
    public function _initialize()
    {
        parent::_initialize();
        $this->assign('index_css',6);
        $this->assign('sie',pageSie(6));//页面描述与关键字
    }
    // 法律资讯
    public function index()
    {
        $type                        = input('type');
        $invoking                    = Loader::model('Question','service');
        $type_list                   = $invoking->newsType();
        $data                        = $invoking->newsList($type);
        $this->assign('type',$type);
        $this->assign('type_list',$type_list);
        $this->assign('list',$data['list']);
        $this->assign('page',$data['page']);
        return $this->fetch();
    }

    // 资讯详情
    public function detail()
    {
        $invoking                    = Loader::model('Question','service');
        $data                        = $invoking->newsDetail();
        $recommend                   = $invoking->newsRecommend();
        $paesie = pageSie(20);
        $paesie['title']  = $data['data']['n_title'];
        $this->assign('sie',$paesie);//页面描述与关键字
        $this->assign('data',$data['data']);
        $this->assign('list',$data['list']);
        $this->assign('recommend',$recommend);
        return $this->fetch();
    }

}
